﻿/**
 * Fonts.cs - Font (typography, in TTF format) - To hide SDL TTF handling
 * 
 * Part of BoulderDAM - A BoulderDash clone using C# and SDL
 * Nacho Cabanes & students of DAM IES San Vicente, 2014
 * 
 * Revisions
 * #     Date         Creator, changes
 * ----  -----------  -------------------------------------------------------
 * 0.01  02-apr-2014  Nacho Cabanes: Ability to load fonts
 */

using Tao.Sdl;
using System;

namespace Boulder
{
    class Font
    {
        private IntPtr internalPointer;

        public Font(string fileName, short sizePoints)
        {
            Load(fileName, sizePoints);
        }

        public void Load(string fileName, short sizePoints)
        {
            internalPointer = SdlTtf.TTF_OpenFont(fileName, sizePoints);
            if (internalPointer == IntPtr.Zero)
                Hardware.FatalError("Font not found: " + fileName);
        }

        public IntPtr GetPointer()
        {
            return internalPointer;
        }
    }
}
